import '../../../style/outSignRecord.less';
import React, {Component} from 'react';
import { inject, observer } from 'mobx-react';
import { withRouter, Route } from 'react-router-dom';
import {Tools} from 'weaver-mobile';
import CustTabs from '../../coms/Tabs';
import RecordRouteLayout from './RecordRouteLayout';
import RecordList from './RecordList';
import MySubordinates from '../../resource/MySubordinates';
import Subordinate from '../subordinate/index';
const getLabel = Tools.getLabel;

@inject('outSignStoreV2')
@inject('outSignRecordStore')
@withRouter
@observer
export default class RecordContainer extends Component {
  componentDidMount(){
    const {outSignRecordStore, outSignStoreV2} = this.props;
    outSignRecordStore.outSignStoreV2 = outSignStoreV2;
  }

  render(){
    const {outSignRecordStore} = this.props;
    const {tabConfig, resourceRecordLayout} = outSignRecordStore;

    return (
      <div className='outSignRecordContainer'>
        <CustTabs store={outSignRecordStore} tabConfig={tabConfig}>
          <RecordList />
          <Subordinate onRowClick={this.onRowClick}/>
        </CustTabs>

        {/* 下属考勤打卡记录页 */}
        <Route key={resourceRecordLayout.id} path={resourceRecordLayout.path} render={() => <RecordRouteLayout store={outSignRecordStore}/>} />
      </div>
    )
  }
}